parse: Add 'kmh' and 'mph' to possible units within distance items.
authoroliskoli <oliskoli>
Sun, 13 Apr 2008 20:45:59 +0000 (20:45 +0000)
committeroliskoli <oliskoli>
Sun, 13 Apr 2008 20:45:59 +0000 (20:45 +0000)
parse.c

diff --git a/parse.c b/parse.c
index ce107a1d3841edfb80ac3a7ef13976b7e17e2f8c..e6ee8b44a19520f2c97eafe397d23be4eb222441 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -101,10 +101,12 @@ parse_speed(const char *str, double *val, const double scale, const char *module
        else if (case_ignore_strcmp(unit, "mps") == 0) ;
        else if (case_ignore_strcmp(unit, "kph") == 0) *val = KPH_TO_MPS(*val);
        else if (case_ignore_strcmp(unit, "km/h") == 0) *val = KPH_TO_MPS(*val);
+       else if (case_ignore_strcmp(unit, "kmh") == 0) *val = KPH_TO_MPS(*val);
        else if (case_ignore_strcmp(unit, "kt") == 0) *val = KNOTS_TO_MPS(*val);
        else if (case_ignore_strcmp(unit, "knot") == 0) *val = KNOTS_TO_MPS(*val);
        else if (case_ignore_strcmp(unit, "mph") == 0) *val = MPH_TO_MPS(*val);
        else if (case_ignore_strcmp(unit, "mi/h") == 0) *val = MPH_TO_MPS(*val);
+       else if (case_ignore_strcmp(unit, "mih") == 0) *val = MPH_TO_MPS(*val);
        else
                fatal("%s: Unsupported speed unit '%s' in item '%s'!\n", module, unit, str);